<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:bi="http://java.sun.com/jsf/composite/bill">
    <h:body>
        <ui:composition template="/resources/template/template.xhtml">
            <ui:define name="content">
                <h:form>
                    <p:panel header="Reprint" >
                        <f:facet name="header" >
                            <h:outputLabel value="Reprint" ></h:outputLabel>
                            <hr/>

                            <p:commandButton ajax="false" value="Cancel" action="channel_payment_staff_bill_cancel" disabled="#{channelSearchController.bill.cancelled eq true}" >                           
                            </p:commandButton>
                        </f:facet>

                        <p:panel>
                            <p:panelGrid columns="2" style="width: 100%;">
                                <p:panel header="Patient Detail">
                                    <p:panelGrid columns="2">
                                        <h:outputLabel value="Staff ​Name:" ></h:outputLabel>
                                        <h:outputLabel value="#{channelSearchController.bill.staff.person.nameWithTitle }" ></h:outputLabel>                                        
                                        <h:outputLabel value="Phone" >
                                        </h:outputLabel>
                                        <h:outputLabel value="#{channelSearchController.bill.staff.person.phone}" >
                                        </h:outputLabel>
                                    </p:panelGrid>
                                </p:panel>
                                <p:panel header="Bill Detail">
                                    <p:panelGrid columns="2">
                                        <h:outputLabel value="Bill No :" ></h:outputLabel>
                                        <h:outputLabel value="#{channelSearchController.bill.insId}" ></h:outputLabel>
                                        <h:outputLabel value="Payment Type : " ></h:outputLabel>
                                        <h:outputLabel value="#{channelSearchController.bill.paymentMethod}" ></h:outputLabel>
                                        <h:outputLabel value="Paid amount :" ></h:outputLabel>
                                        <h:outputLabel value="#{channelSearchController.bill.total}" ></h:outputLabel>
                                    </p:panelGrid>
                                </p:panel>
                            </p:panelGrid>

                            <p:panel header="Bill Fee Detail">
                                <p:dataTable value="#{channelSearchController.billItems}" var="bip21" emptyMessage="No Items" >
                                    <p:column headerText="Bill No">
                                        <h:outputLabel value="#{bip21.referenceBill.insId}" />
                                    </p:column>
                                    <p:column headerText="Date">
                                        <h:outputLabel value="#{bip21.referenceBill.createdAt}" />
                                    </p:column>
                                    <p:column headerText="Test/Service">
                                        <h:outputLabel value="#{bip21.paidForBillFee.billItem.item.name}" />
                                    </p:column>
                                    <p:column headerText="Fee" >
                                        <h:outputLabel value="#{bip21.netValue}" />
                                    </p:column>
                                </p:dataTable>
                            </p:panel>
                        </p:panel>
                    </p:panel>



                </h:form>

                <h:form >

                    <h:panelGroup id="gpBillPreview">

                        <p:commandButton value="Print" styleClass="noPrintButton" ajax="false" action="#" >
                            <p:printer target="gpBillPreview" ></p:printer>
                        </p:commandButton>

                        <h:panelGroup rendered="#{sessionController.loggedPreference.opdBillPaperType eq 'FiveFivePaper'}">
                            <h:panelGroup rendered="#{!sessionController.loggedPreference.pharmacyBillPrabodha}">
                                <bi:staffBill_1  controller="#{channelSearchController}" bill="#{channelSearchController.bill}" dup="true"/>
                            </h:panelGroup>
                        </h:panelGroup>


                        <h:panelGroup rendered="#{sessionController.loggedPreference.opdBillPaperType eq 'PosPaper'}">
                            <h:panelGroup rendered="#{sessionController.loggedPreference.pharmacyBillPrabodha}" > 
                                <bi:paymentReciptPosDouble controller="#{channelSearchController}" bill="#{channelSearchController.bill}" dup="true"/>
                            </h:panelGroup>
                        </h:panelGroup>
                    </h:panelGroup>

<!--                    <bi:staffBill  bill="#{channelSearchController.bill}" dup="true" controller="#{channelSearchController}" >
                    </bi:staffBill>-->
                    
                </h:form>

            </ui:define>



        </ui:composition>

    </h:body>
</html>
